Set ArgObj = WScript.Arguments

shortcutPath = ArgObj(0)
shortcutFilename = ArgObj(1)
target = ArgObj(2)
desc = ArgObj(3)
fullpath = shortcutPath & shortcutFilename

Set fso = CreateObject("Scripting.FileSystemObject")

CreateFolder(shortcutPath)

set WshShell = WScript.CreateObject("WScript.Shell")
set oShellLink = WshShell.CreateShortcut(fullpath)
oShellLink.TargetPath = target
oShellLink.WindowStyle = 1
oShellLink.Description = desc
oShellLink.Save
WScript.Quit(0)

Sub CreateFolder(folderUrl)

    folderUrl = fso.GetAbsolutePathName(folderUrl)
    If (Not fso.folderExists(fso.GetParentFolderName(folderUrl))) then
	' Call CreateFolder recursively to create the parent folder
	CreateFolder(fso.GetParentFolderName(folderUrl))
    End If

    ' Create the current folder if the parent exists
    If Not fso.folderExists(folderUrl) Then
        fso.CreateFolder(folderUrl)
    End If
End Sub

